﻿using System;
using System.Collections.Generic;

namespace BookTheBook.Data.Model
{
    public class Book
    {
        public virtual int Id { get; private set; }
        public virtual string ISBN { get; set; }
        public virtual string Title { get; set; }
        public virtual string Author { get; set; }
        public virtual string Publisher { get; set; }
        public virtual string Edition { get; set; }
        public virtual string Currency { get; set; }
        public virtual string DetailsUrl { get; set; }
        public virtual string ImageUrl { get; set; }
        public virtual decimal Price { get; set; }
        public virtual decimal Rating { get; set; }
        public virtual byte[] Image { get; set; }
        public virtual DateTime PublishYear { get; set; }
        public virtual string Description { get; set; }
        public virtual IList<Copy> Copies { get; private set; }

        public Book()
        {
            Copies = new List<Copy>();
        }

        public virtual void AddCopy(Copy copy)
        {
            copy.Book = this;
            Copies.Add(copy);
        }
    }
}


